From 3781952178f3424cbb3b64190990ecff21e8643e Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Thu, 24 Dec 2009 08:59:47 +0000 Subject: [PATCH] xend: Fix 'monitor' domain config parameter. Introduce new 'monitor_path' parameter, so that 'monitor' can revert to its old type and meaning. Fixes domain reboot and save/restore. Signed-off-by: Keir Fraser --- tools/python/xen/xend/XendConfig.py | 3 ++- tools/python/xen/xend/image.py | 10 ++++------ tools/python/xen/xm/create.py | 13 ++++++++++--- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/tools/python/xen/xend/XendConfig.py b/tools/python/xen/xend/XendConfig.py index dfcb984e11..216665a4e0 100644 --- a/tools/python/xen/xend/XendConfig.py +++ b/tools/python/xen/xend/XendConfig.py @@ -145,7 +145,8 @@ XENAPI_PLATFORM_CFG_TYPES = { 'keymap': str, 'isa' : int, 'localtime': int, - 'monitor': str, + 'monitor': int, + 'monitor_path': str, 'nographic': int, 'nomigrate': int, 'pae' : int, diff --git a/tools/python/xen/xend/image.py b/tools/python/xen/xend/image.py index c13e93ad2e..44ee97c863 100644 --- a/tools/python/xen/xend/image.py +++ b/tools/python/xen/xend/image.py @@ -371,13 +371,11 @@ class ImageHandler: if vmConfig['platform'].get('parallel'): ret = ret + ["-parallel", vmConfig['platform'].get('parallel')] - if type(vmConfig['platform'].get('monitor', 0)) is int: - if int(vmConfig['platform'].get('monitor', 0)) != 0: - ret = ret + ['-monitor', 'vc'] + if int(vmConfig['platform'].get('monitor', 0)) != 0: + if vmConfig['platform'].get('monitor_path'): + ret = ret + ['-monitor', vmConfig['platform'].get('monitor_path')] else: - ret = ret + ['-monitor', 'null'] - else: - ret = ret + ['-monitor', vmConfig['platform'].get('monitor', 0)] + ret = ret + ['-monitor', 'vc'] return ret diff --git a/tools/python/xen/xm/create.py b/tools/python/xen/xm/create.py index d89a23e3a1..73a6121c63 100644 --- a/tools/python/xen/xm/create.py +++ b/tools/python/xen/xm/create.py @@ -511,10 +511,14 @@ gopts.var('serial', val='FILE', fn=set_value, default='', use="Path to serial or pty or vc") -gopts.var('monitor', val='0|1|FILE', - fn=set_value, default=1, +gopts.var('monitor', val='no|yes', + fn=set_bool, default=0, use="""Should the device model use monitor?""") +gopts.var('monitor_path', val='FILE', + fn=set_value, default='', + use="Non-default path to device model monitor") + gopts.var('localtime', val='no|yes', fn=set_bool, default=0, use="Is RTC set to localtime?") @@ -745,7 +749,10 @@ def configure_image(vals): config_image.append(['parallel', vals.parallel]) if vals.serial: config_image.append(['serial', vals.serial]) - if vals.monitor: + if vals.monitor_path: + config_image.append(['monitor_path', vals.monitor_path]) + config_image.append(['monitor', 1]) + elif vals.monitor: config_image.append(['monitor', vals.monitor]) if vals.extra: config_image.append(['args', vals.extra]) -- 2.30.2